begintownscript;

variables;
short creature_count = 0; //Used for naming large clumps of creatures
short exit_scen_choice = 0;
body;

beginstate 0; //INIT_STATE
//Specialize the roaches
	set_name(6, "Roach Guard");
	set_name(7, "Roach Guard");
	set_level(6, 25);
	set_level(7, 25);
break;

beginstate 1; //EXIT_STATE - Walk out into the sunlight
	if (get_flag(2,0) != 1) {
	reset_dialog();
	message_dialog("Having been underground for quite some time, you stumble around in the sunlight for a while, trying to get your bearings. Soon you're ready to proceed to find out what just happened to you.","");
	set_flag(2,0,1);
	}
	else
		end();
break;

beginstate 2; //START_STATE

break;

beginstate 10;  //Guards Message
	reset_dialog();
	message_dialog("You climb the ruined staircase only to find that the hallway here has caved in completely. It's completely impassable, and digging your way out would take weeks.","There must be another way out somewhere...");
	block_entry(1);
break;

beginstate 11; //Easy exit (testing purposes only)
	reset_dialog();
	message_dialog("Just so you know, you just exited the scenario. Your record will be untouched. You might want to avoid stepping here next time (don't worry, the secret passage isn't here).","");
	end_scenario(2);
break;

beginstate 12; //General dungeon appearance
	if(get_flag(2,2) != 1) {
		reset_dialog();
		message_dialog("You step out of your cell, only to see that the others are heavily damaged by cave-ins. It looks like these cells haven't been used for ages, and it really shows." ,"You wonder who built these, and to what end, but the need to escape overrides your curiosity. You must find a way to get back to the Order somehow.");
		set_flag(2,2,1);
	}
	set_total_visibility(0);
	break;